from django.db.models import Count
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status

from artmarket.models import Comment
from artmarket.serializers import CommentListSerializer


class CommentStatisticView(APIView):
    def get(self, request):
        comment_objects_all = Comment.objects.all()

        serializer = CommentListSerializer(comment_objects_all, many=True)
        response_data = {
            'data': serializer.data,
        }

        return Response(response_data, status=status.HTTP_200_OK)
